<template>
  <div>
    <keep-alive include="Index">
      <router-view></router-view>
    </keep-alive>
  </div>
</template>

<script>
import { mapState } from "vuex";
export default {
  name: "App",

  data() {
    return {};
  },
  computed: {
    ...mapState({
      status: (state) => state.user.status,
    }),
  },
  mounted() {
    console.log(this.status);
    this.$store.commit("initUser");
    
    this.$bus.$on("updateCart", () => {
      this.$store.dispatch("updateCartList");
    });

        console.log(this.status);
    if (this.status == 1) {
      var cart = this.$store.dispatch("updateCartList");
    }
    // this.$store.dispatch('updateCartList')
  },

  methods: {},
};
</script>

<style>
* {
  margin: 0;
  padding: 0;
}

i {
  font-size: 20px;
}

h6 {
  font-size: 16px;
}

p,
del,
span {
  font-size: 14px;
}
</style>
